<?php 
session_start();
$username = "rm.herwidodo@babytivities.com";
$password = "234";
$url = "http://localhost:8080/moms-diary/".$_REQUEST['q'];

$auth = $username.":".$password;

$context = stream_context_create(array(
    'http' => array(
        'header'  => "Authorization: Basic " . base64_encode($auth)
	)
));
$data = file_get_contents($url, false, $context);
if(isset($data)) {
//		echo "<img src='data:image/png;base64,".base64_encode($data)."' />";
		header("Content-type: image/png");
		//echo "data:image/png;base64,".base64_encode($data);
		echo $data;
}
?>